﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Mag.Model.Staff>" %>
<%@ Import Namespace="ChoViet.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Chi tiết
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
	Nhân sự
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>  
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">
	<%= Html.Toolbar("Sửa", string.Format("/Staff/Edit/{0}", Model.ID), "edit")%>
	<%= Html.Toolbar("Xóa", string.Format("/Staff/Delete/{0}", Model.ID), "delete")%>
	<%= Html.Toolbar("Quay lại", "/Staff", "back")%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%if(ViewData["MessageInfo"]==null){ %>
	<fieldset>
		<legend>Chi tiết</legend>
		<table class="admintable">
			<tbody><tr>
				<td class="key">Họ tên</td>
				<td><%= Html.Encode(Model.Name) %></td>
			</tr>
			<tr>
				<td class="key">Đơn vị</td>
				<td><%= Html.Encode(Model.Organization.ParentOrganization.Name) %></td>
			</tr>
			<tr>
				<td class="key">Bộ phận</td>
				<td><%= Html.Encode(Model.Organization.Name) %></td>
			</tr>
			<tr>
				<td class="key">Địa chỉ</td>
				<td>
					<%= Html.Encode(Model.Address)%>
				</td>		
			</tr>
			<tr>
				<td class="key">Điện thoại</td>
				<td><%= Html.Encode(Model.Phone) %></td>
			</tr>
			<tr>
				<td class="key">Fax</td>
				<td><%= Html.Encode(Model.Fax) %></td>
			</tr>
			<tr>
				<td class="key">Email</td>
				<td><%= Html.Encode(Model.Email) %></td>
			</tr>
			<tr>
				<td class="key">Nghề nghiệp</td>
				<td><%= Html.Encode(Model.Profession.Name) %></td>
			</tr>
			<tr>
				<td class="key">Chức danh</td>
                <td>
                    <ul>
                        <%var positions = Model.StaffPositionMaps.ToList();
                          if (positions.Count > 0)
                          {
                              foreach (var item in positions)
                              { %>
                        <li>
                            <%=item.Position.Name %></li>
                        <%}
                        }
                        %>
                     </ul>
                </td>
			</tr>
			</tbody>
		 </table>
	 </fieldset>
<% } %>
</asp:Content>

